package com.session06;

import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int year = num.nextInt();
        int month = num.nextInt();
        int day = num.nextInt();
        System.out.println(Day(year, month, day));
    }

    /**
     * 定义一个函数，接收三个整型数据(年、月、日)，计算出该日期是今年的第多少天？
     *
     * @param year
     * @param month
     * @param day
     * @return
     */
    public static int Day(int year, int month, int day) {
        int num = 0;
        for (int i = 1; i < month; i++) {
            switch (i) {
                //一直执行，直到出现break;
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
                    num += 31;
                    break;
                case 2:
                    num += ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 29 : 28;
                    break;
                default:
                    num += 30;
            }
        }
        num += day;
        return num;
    }
}
